
CC = gcc

TARGET ?= poker

CFLAGS = -I.

LDFLAGS = -lSDL -lSDL_image -lSDL_ttf -lSDL_mixer -lSDL_net

LIBS = main.o
LIBS += poker.o
LIBS += res.o
LIBS += gui.o
LIBS += input.o
LIBS += sdl.o
LIBS += sdl_net.o
LIBS += button.o

.PHONY:$(TARGET)

all:clean $(TARGET)
	./$(TARGET)

$(TARGET):$(LIBS)
	$(CC) -g $^ -o $@ $(LDFLAGS)

%.o:%.c
	$(CC) -g -c $< -o $@ $(CFLAGS)

test:
	gcc test.c sdl.c button.c -I. -lSDL -lSDL_ttf -lSDL_image -lSDL_mixer

clean:
	rm $(LIBS) $(TARGET) -f
